#ifndef DESCENDANTVIEW_H
#define DESCENDANTVIEW_H

#include <QListView>

template <typename Type> class GraphNode;
class SectionDescendantModel;
class SectionInfo;

class SectionDescendantView : public QListView
{
    Q_OBJECT
public:
    explicit SectionDescendantView(QWidget *parent = 0);

    const GraphNode<SectionInfo>* selectedSectionNode() const;
    GraphNode<SectionInfo>* selectedSectionNode();

public slots:
    void setSectionNode (GraphNode<SectionInfo>* sectionNode);
    void initialize();

signals:
    void sectionChosen (GraphNode<SectionInfo>* sectionNode);

private slots:
    void selectionChanged();

private:
    SectionDescendantModel* m_model;
    GraphNode<SectionInfo>* m_originalSectionNode;
};

#endif // DESCENDANTVIEW_H
